<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="org.tools.wstt.reference.ApplicationComponent"%>

<c:set var="title" scope="request">Probe Remote Servers</c:set>

<jsp:include page="/WEB-INF/jsp/inc/head.jsp" />

		<h2>Probe a remote Server</h2>

		<h3>Enter Remote Server informations</h3>
		<form method="POST" action="<c:out value="${servicesPath}" /><%=ApplicationComponent.URI_PROBE %>">
			<p>
				<label for="host">Host : </label><input id="host" type="text" name="host" /><br />
				<label for="port">Port : </label><input id="port" type="text" name="port" /><br />
				<label for="timeout">Timeout in ms : </label><input id="timeout" type="text" name="timeout" value="5000" /><br />
				<input type="submit" value="Probe" />
			</p>
		</form>
		
		<h2>Probe Results History</h2>
		<div id="probe_results">
			<p><em>only the last <%=ApplicationComponent.APP_PROBE_REMIND_CALLS %> probes are viewable.</em></p>
			<table>
				<tbody>
					<tr>
						<th>Destination Host</th>
						<th>Destination Port</th>
						<th>Status</th>
						<th>Date</th>
						<th>Time elapsed (ms)</th>
					</tr>
					<c:forEach var="call" items="${applicationScope['PROBE_CALLS']}">
						<tr>
							<td><c:out value="${call.host}" /></td>
							<td><c:out value="${call.port}" /></td>
							<td><c:out value="${call.status}" /></td>
							<td><fmt:formatDate pattern="dd/MM/yyyy HH:mm:SS" value="${call.date}" timeZone="GTM+1" /></td>
							<td><c:out value="${call.time}" /></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>

<jsp:include page="/WEB-INF/jsp/inc/foot.jsp" />